package com.example.cartmanage.chewei.model

import com.example.cartmanage.bean.CartListEntity
import com.example.cartmanage.chewei.entity.AddCheweiitem
import com.example.cartmanage.chewei.entity.CheweiEntityItem
import com.example.cartmanage.chewei.entity.SearchCheweiEntity
import com.example.lib_base.mvvm.Res
import okhttp3.RequestBody
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path

interface ApiService {
    @GET("/api/parking-spaces/area/{areaId}")
  suspend  fun getcheweiList(@Path("areaId") areaId:Int):Res<MutableList<CheweiEntityItem>>
  @POST("/api/parking-spaces")
  suspend fun addChewei(@Body body:RequestBody):Res<AddCheweiitem>
  @DELETE("/api/parking-spaces/{id}")
  suspend fun delChewei(@Path("id") id:Int):Res<Boolean>
  @GET("/api/parking-spaces/{id}")
  suspend fun detailChewei(@Path("id") id:Int):Res<CheweiEntityItem>
  @PUT("/api/parking-spaces/{id}")
  suspend fun editChewei(@Path("id") id:Int,@Body body:RequestBody):Res<CheweiEntityItem>
  @GET("/api/parking-spaces/status/{spaceStatus}")
  suspend fun searchChewei(@Path("spaceStatus") spaceStatus:String):Res<SearchCheweiEntity>
  @GET("/api/parking-spaces/type/{spaceType}")
  suspend fun searchCheweiType(@Path("spaceType") spaceType:String):Res<SearchCheweiEntity>
  @GET("/api/parking-spaces/license/{licensePlate}")
  suspend fun searchCheweiLicense(@Path("licensePlate") licensePlate:String):Res<SearchCheweiEntity>
}